
package com.projectxxxxxxxxxx.info;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileFilter;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.RandomAccessFile;
import java.math.BigDecimal;
import java.util.TreeMap;
import java.util.regex.Pattern;

import android.app.ActivityManager;
import android.app.ActivityManager.MemoryInfo;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.BatteryManager;
import android.os.Build;
import android.os.Environment;
import android.os.StatFs;
import android.util.Log;

import com.projectxxxxxxxxxx.RoboApplication;
import com.projectxxxxxxxxxx.utils.UiUtils;

public enum Info {
        
	CPU_USAGE {
        @Override
		public TreeMap<String, String> get() {
			TreeMap<String, String> map = new TreeMap<String, String>();
			map.put(INFO_CPU_USAGE, Long.toString(getCpuUsage()));
            return map;
        }

		private int getCpuUsage() {
            try {
				RandomAccessFile reader = new RandomAccessFile(FILE_STAT, FILE_MODE_READ);
                String load = reader.readLine();
                
				String[] toks = load.split(SEPARATE_SPACE);

                long idle1 = Long.parseLong(toks[5]);
                long cpu1 = Long.parseLong(toks[2]) + Long.parseLong(toks[3]) + Long.parseLong(toks[4])
                        + Long.parseLong(toks[6]) + Long.parseLong(toks[7]) + Long.parseLong(toks[8]);

                try {
                    Thread.sleep(360);
                } catch (Exception e) {
                }

                reader.seek(0);
                load = reader.readLine();
                reader.close();
				toks = load.split(SEPARATE_SPACE);

                long idle2 = Long.parseLong(toks[5]);
                long cpu2 = Long.parseLong(toks[2]) + Long.parseLong(toks[3]) + Long.parseLong(toks[4])
                        + Long.parseLong(toks[6]) + Long.parseLong(toks[7]) + Long.parseLong(toks[8]);
              
                float cpuUsage = (cpu2 + idle2) - (cpu1 + idle1);
                cpuUsage = (cpu2 - cpu1) / cpuUsage;
				cpuUsage *= 100;
				return (int) cpuUsage;

            } catch (IOException ex) {
                ex.printStackTrace();
            }
			return 0;
		}
    },
	CPU_DATA {

		@Override
		public TreeMap<String, String> get() {
			TreeMap<String, String> map = new TreeMap<String, String>();
			map.put(INFO_CPU_PROCESSOR, getCpuProcessor()); // тип - Arm...
			map.put(INFO_CPU_CORES, Integer.toString(getCpuCores()));
			map.put(INFO_CPU_BOGO_MIPS, Double.toString(getCpuBogoMips()));
			map.put(INFO_CPU_FREQUENCY_CUR, Integer.toString(getCpuFrequencyCur()));
			map.put(INFO_CPU_FREQUENCY_MIN, Integer.toString(getCpuFrequencyMin()));
			map.put(INFO_CPU_FREQUENCY_MAX, Integer.toString(getCpuFrequencyMax()));

			return map;
		}

		private String getCpuProcessor() {
			String processor = "";
			RandomAccessFile reader;
			try {
				reader = new RandomAccessFile(FILE_CPU_INFO, FILE_MODE_READ);
				processor = reader.readLine();
				processor = processor.split(": ")[1];
				reader.close();
			} catch (IOException ex) {
				ex.printStackTrace();
			}
			return processor;
		}

		private int getCpuCores() {
			int cores = 1;

			try {
				File dir = new File(FILE_CPU_CORES);
				File[] files = dir.listFiles(new CpuFilter());
				cores = files.length;
			} catch (Exception ex) {
				ex.printStackTrace();
			}
			return cores;
		}

		class CpuFilter implements FileFilter {
			@Override
			public boolean accept(File pathname) {
				// Check if filename is "cpu", followed by a single digit number
				if (Pattern.matches("cpu[0-9]", pathname.getName())) {
					return true;
				}
				return false;
			}
		}

		private double getCpuBogoMips() {
			String bogoMIPS = "";
			RandomAccessFile reader;
			try {
				reader = new RandomAccessFile(FILE_CPU_INFO, FILE_MODE_READ);
				bogoMIPS = reader.readLine();
				bogoMIPS = reader.readLine();
				bogoMIPS = bogoMIPS.split(": ")[1];
				reader.close();
			} catch (IOException ex) {
				ex.printStackTrace();
			}
			return Double.parseDouble(bogoMIPS);
		}

		private int getCpuFrequencyCur() {
			String frequency = "0";
			RandomAccessFile reader;
			try {
				reader = new RandomAccessFile(FILE_CPU_FREQUENCY_CUR, FILE_MODE_READ);
				frequency = reader.readLine();
				reader.close();
			} catch (IOException ex) {
				ex.printStackTrace();
			}
			return Integer.parseInt(frequency);
		}

		private int getCpuFrequencyMin() {
			String frequency = "0";
			RandomAccessFile reader;
			try {
				reader = new RandomAccessFile(FILE_CPU_FREQUENCY_MIN, FILE_MODE_READ);
				frequency = reader.readLine();
				reader.close();
			} catch (IOException ex) {
				ex.printStackTrace();
			}
			return Integer.parseInt(frequency);
		}

		private int getCpuFrequencyMax() {
			String frequency = "0";
			RandomAccessFile reader;
			try {
				reader = new RandomAccessFile(FILE_CPU_FREQUENCY_MAX, FILE_MODE_READ);
				frequency = reader.readLine();
				reader.close();
			} catch (IOException ex) {
				ex.printStackTrace();
			}
			return Integer.parseInt(frequency);
		}

    },
	MEMORY_USAGE {

        @Override
		public TreeMap<String, String> get() {
			TreeMap<String, String> map = new TreeMap<String, String>();
			map.put(INFO_MEMORY_USAGE, Integer.toString((int) (Math.round(getRamUsage()))));
            return map;
        }

		private double getRamUsage() {
			double ram = 0;
			String allmem = "";
			String allmemtoks = "";
			String freemem = "";
			String freememtoks = "";
			RandomAccessFile reader;

			try {
				reader = new RandomAccessFile(FILE_MEMORY_INFO, FILE_MODE_READ);

				allmem = reader.readLine();
				allmemtoks = allmem.split(": ")[1];
				allmem = allmemtoks.split(SEPARATE_MANY_SPACE)[1];

				MemoryInfo mi = new MemoryInfo();
				ActivityManager activityManager = (ActivityManager) RoboApplication.getInstance().getSystemService(
						Context.ACTIVITY_SERVICE);
				activityManager.getMemoryInfo(mi);
				freemem = Long.toString(mi.availMem / 1024L);

				ram = 100 - Double.parseDouble(freemem) * 100 / Double.parseDouble(allmem);

				reader.close();

				int decimalPlace = 2;
				BigDecimal bd = new BigDecimal(ram);
				bd = bd.setScale(decimalPlace, BigDecimal.ROUND_UP);
				ram = bd.doubleValue();

			} catch (IOException ex) {
				ex.printStackTrace();
			}
			return ram;
		}

    },
	MEMORY_DATA {
		@Override
		public TreeMap<String, String> get() {
			TreeMap<String, String> map = new TreeMap<String, String>();
			map.put(INFO_MEMORY_TOTAL, Long.toString(getRamTotal()));
			map.put(INFO_MEMORY_FREE, Long.toString(getRamFree()));
			map.put(INFO_MEMORY_USED, Long.toString(getRamTotal() - getRamFree()));
			return map;
		}

		public long getRamTotal() {
			String allmem = "";
			String allmemtoks = "";
			RandomAccessFile reader;
			try {
				reader = new RandomAccessFile(FILE_MEMORY_INFO, FILE_MODE_READ);
				allmem = reader.readLine();

				allmemtoks = allmem.split(": ")[1];
				allmem = allmemtoks.split(SEPARATE_MANY_SPACE)[1];

				reader.close();
			} catch (IOException ex) {
				ex.printStackTrace();
			}
            return Long.parseLong(allmem) * 1024;
		}

		public long getRamFree() {
			if(true) {
				MemoryInfo mi = new MemoryInfo();
				ActivityManager activityManager = (ActivityManager) RoboApplication.getInstance().getSystemService(
						Context.ACTIVITY_SERVICE);
				activityManager.getMemoryInfo(mi);
				//long availableMegs = mi.availMem / 1048576L;
				long bytes = mi.availMem;

				return bytes;
			} else {
				String freemem = "";
				String freememtoks = "";
				RandomAccessFile reader;
				try {
					reader = new RandomAccessFile(FILE_MEMORY_INFO, FILE_MODE_READ);
					freemem = reader.readLine();
					freemem = reader.readLine();
					freememtoks = freemem.split(": ")[1];
					freemem = freememtoks.split(SEPARATE_MANY_SPACE)[1];
					Log.i(getClass().toString(), " next -  " + reader.readLine());
					Log.i(getClass().toString(), " next -  " + reader.readLine());
					Log.i(getClass().toString(), " next -  " + reader.readLine());
					reader.close();
				} catch (IOException ex) {
					ex.printStackTrace();
				}
				return Long.parseLong(freemem);

			}
		}

	},
	STORAGE_INTERNAL_USAGE {
		@Override
		public TreeMap<String, String> get() {

			TreeMap<String, String> map = new TreeMap<String, String>();

			float internalUsage = getStorageInternalFree();
			internalUsage = internalUsage / getStorageInternalTotal();
			internalUsage = internalUsage * 100;
			internalUsage = 100 - internalUsage;

			map.put(INFO_STORAGE_INTERNAL_USAGE, Integer.toString(Math.round(internalUsage)));
			return map;
		}

		private long getStorageInternalTotal() {
            StatFs stat = new StatFs(Environment.getDataDirectory().getAbsolutePath());
			long bytes = (long) stat.getBlockSize() * (long) stat.getBlockCount();
			bytes /= 1048576L;
			return bytes;
		}

		private long getStorageInternalFree() {
            StatFs stat = new StatFs(Environment.getDataDirectory().getAbsolutePath());
			long bytesAvailable = (long) stat.getBlockSize() * (long) stat.getAvailableBlocks();
			bytesAvailable /= 1048576L;
			return bytesAvailable;
		}

	},
	STORAGE_INTERNAL_DATA {
		@Override
		public TreeMap<String, String> get() {

			TreeMap<String, String> map = new TreeMap<String, String>();
			map.put(INFO_STORAGE_INTERNAL_TOTAL, Long.toString(getStorageInternalTotal()));
			map.put(INFO_STORAGE_INTERNAL_FREE, Long.toString(getStorageInternalFree()));
			map.put(INFO_STORAGE_INTERNAL_USED, Long.toString(getStorageInternalTotal() - getStorageInternalFree()));
			return map;

		}

		private long getStorageInternalTotal() {
            StatFs stat = new StatFs(Environment.getDataDirectory().getAbsolutePath());
			long bytes = (long) stat.getBlockSize() * (long) stat.getBlockCount();
			bytes /= 1048576L;
			return bytes;
		}

		private long getStorageInternalFree() {
            StatFs stat = new StatFs(Environment.getDataDirectory().getAbsolutePath());
			long bytes = (long) stat.getBlockSize() * (long) stat.getAvailableBlocks();
			bytes /= 1048576L;
			return bytes;
		}

	},
	STORAGE_EXTERNAL_USAGE {
		@Override
		public TreeMap<String, String> get() {

			TreeMap<String, String> map = new TreeMap<String, String>();

			float externalUsage = getStorageExternalFree();
			externalUsage = externalUsage / getStorageExternalTotal();
			externalUsage = externalUsage * 100;
			externalUsage = 100 - externalUsage;

			map.put(INFO_STORAGE_EXTERNAL_USAGE, Integer.toString(Math.round(externalUsage)));

			return map;
		}

		private long getStorageExternalTotal() {
			StatFs stat = new StatFs(Environment.getExternalStorageDirectory().getAbsolutePath());
			long bytes = (long) stat.getBlockSize() * (long) stat.getBlockCount();
			bytes /= 1048576L;
			return bytes;
		}

		private long getStorageExternalFree() {
			StatFs stat = new StatFs(Environment.getExternalStorageDirectory().getAbsolutePath());
			long bytes = (long) stat.getBlockSize() * (long) stat.getAvailableBlocks();
			bytes /= 1048576L;
			return bytes;
		}
	},
	
	STORAGE_EXTERNAL_DATA {
		@Override
		public TreeMap<String, String> get() {

			TreeMap<String, String> map = new TreeMap<String, String>();
			map.put(INFO_STORAGE_EXTERNAL_TOTAL, Long.toString(getStorageExternalTotal()));
			map.put(INFO_STORAGE_EXTERNAL_FREE, Long.toString(getStorageExternalFree()));
			map.put(INFO_STORAGE_EXTERNAL_USED, Long.toString(getStorageExternalTotal() - getStorageExternalFree()));
			return map;
		}

		private long getStorageExternalTotal() {
			StatFs stat = new StatFs(Environment.getExternalStorageDirectory().getAbsolutePath());
			long bytes = (long) stat.getBlockSize() * (long) stat.getBlockCount();
			bytes /= 1048576L;
			return bytes;
		}

		private long getStorageExternalFree() {
			StatFs stat = new StatFs(Environment.getExternalStorageDirectory().getAbsolutePath());
			long bytes = (long) stat.getBlockSize() * (long) stat.getAvailableBlocks();
			bytes /= 1048576L;
			return bytes;
		}
	},
	
	BATTERY {
        @Override
		public TreeMap<String, String> get() {
			TreeMap<String, String> map = new TreeMap<String, String>();
			map.put(INFO_BATERRY_LAVEL, Integer.toString(getBaterryLavel()));
			map.put(INFO_BATERRY_TEMPERATURE, Integer.toString(getBaterryTemperature()));

            return map;
        }
        
		private int getBaterryLavel() {
			Intent batteryIntent = RoboApplication.getInstance().getApplicationContext()
					.registerReceiver(null, new IntentFilter(Intent.ACTION_BATTERY_CHANGED));
			int rawlevel = batteryIntent.getIntExtra(BatteryManager.EXTRA_LEVEL, -1);
			double scale = batteryIntent.getIntExtra(BatteryManager.EXTRA_SCALE, -1);
			double level = -1;
			if (rawlevel >= 0 && scale > 0) {
				level = (rawlevel / scale) * 100;
			}
			return (int) level;
		}

		private int getBaterryTemperature() {

			Intent batteryIntent = RoboApplication.getInstance().getApplicationContext()
					.registerReceiver(null, new IntentFilter(Intent.ACTION_BATTERY_CHANGED));
			int temperature = batteryIntent.getIntExtra(BatteryManager.EXTRA_TEMPERATURE, 0);

			// temperature = (int) (new UnitConverter()).ConvertTemperature(temperature,
			// UnitConverter.TemperatureUnit.Kelvin, UnitConverter.TemperatureUnit.Celsius);
			
			return temperature / 10;
		}

	},
	SYSTEM {
        
        @Override
		public TreeMap<String, String> get() {

            TreeMap<String, String> map = new TreeMap<String, String>();
			String version = Build.VERSION.RELEASE;
			if(version.length() > 3) {
				try {
					Integer.parseInt(version.charAt(4) + "");
					version = version.substring(0, 5);
				}
				catch(NumberFormatException nFE) {
					version = version.substring(0, 3);
				}
			}
			
			map.put(INFO_ANDROID_VERSION, version);
			map.put(INFO_PHONE_MODEL, android.os.Build.MODEL);
			return map;
		}
	},
	NETWORK {

		// private final Handler objHandler = new Handler();
		private final int timeDelay = 1000;

		final public String DEV_FILE = "/proc/self/net/dev";
		String[] gprsdata = { "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0" };
		String[] wifidata = { "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0" };

		String[] firstData = null;
		String[] lastData = { "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0" };

		//final String LOCALLINE = "    lo";
		final String GPRSLINE = "rmnet0";
		//
		final String ETHLINE = "  eth0";
		final String WIFILINE = "tiwlan0";
		final String WLANLINE = "wlan0";
		final String WLANLINE_1 = "  wlan0";


		final String TEXT_ENCODING = "UTF-8";

		long networkWifiTransmitTraffic = 0;
		long networkWifiTransmitSpeed = 0;
		long networkWifiReceiveTraffic = 0;
		long networkWifiReceiveSpeed = 0;

		long networkGprsTransmitTraffic = 0;
		long networkGprsTransmitSpeed = 0;
		long networkGprsReceiveTraffic = 0;
		long networkGprsReceiveSpeed = 0;

		String log = "";


		@Override
		public TreeMap<String, String> get() {
			TreeMap<String, String> map = new TreeMap<String, String>();


			refresh();

			//
			map.put(INFO_NETWORK_WIFI_TRANSMIT_TRAFFIC, Long.toString(networkWifiTransmitTraffic));
			map.put(INFO_NETWORK_WIFI_TRANSMIT_SPEED, UiUtils.humanReadableByteCount(networkWifiTransmitSpeed, true)
					+ "/s ");
			map.put(INFO_NETWORK_WIFI_RECEIVE_TRAFFIC, Long.toString(networkWifiReceiveTraffic));
			map.put(INFO_NETWORK_WIFI_RECEIVE_SPEED, UiUtils.humanReadableByteCount(networkWifiReceiveSpeed, true)
					+ "/s ");
			//
			map.put(INFO_NETWORK_GPRS_TRANSMIT_TRAFFIC, Long.toString(networkGprsTransmitTraffic));
			map.put(INFO_NETWORK_GPRS_TRANSMIT_SPEED, UiUtils.humanReadableByteCount(networkGprsTransmitSpeed, true)
					+ "/s ");
			map.put(INFO_NETWORK_GPRS_RECEIVE_TRAFFIC, Long.toString(networkGprsReceiveTraffic));
			map.put(INFO_NETWORK_GPRS_RECEIVE_SPEED, UiUtils.humanReadableByteCount(networkGprsReceiveSpeed, true)
					+ "/s ");

			map.put(INFO_NETWORK_LOG, log);

			return map;
		}

		public void readdev() {
			FileReader fstream = null;
			try {
				fstream = new FileReader(DEV_FILE);
			} catch (FileNotFoundException e) {
				e.printStackTrace();
				return;
			}
			BufferedReader in = new BufferedReader(fstream, 500);
			String line;
			String[] segs;
			String[] netdata;

			int k;
			int j;
			log = "";
			try {
				while ((line = in.readLine()) != null) {
					log += line + " ..........................................................................    ";
					segs = line.trim().split(":");
					// if (line.startsWith(/* GPRSLINE */LOCALLINE)) {
					if (line.startsWith(GPRSLINE)) {
						netdata = segs[1].trim().split(" ");
						for (k = 0, j = 0; k < netdata.length; k++) {
							if (netdata[k].length() > 0) {
								gprsdata[j] = netdata[k];
								j++;
							}
						}
						// } else if (line.startsWith(/* WIFILINE */ETHLINE)) { // FIXME eth - tiwlan
					} else if (line.startsWith(WIFILINE) || line.startsWith(ETHLINE) || line.startsWith(WLANLINE) || line.startsWith(WLANLINE_1)) { // FIXME
						netdata = segs[1].trim().split(" ");
						for (k = 0, j = 0; k < netdata.length; k++) {
							if (netdata[k].length() > 0) {
								wifidata[j] = netdata[k];
								j++;
							}
						}
					}
				}
				fstream.close();
			} catch (IOException e) {

			}
		}

		public String[] getLastData() {
			return lastData;
		}

		public void setLastData(String[] data) {
			lastData = data;
		}

		public void refresh() {

			readdev();

			String[] newData = new String[] { gprsdata[0], gprsdata[1], gprsdata[8], gprsdata[9], wifidata[0],
					wifidata[1], wifidata[8], wifidata[9] };
			if (firstData == null) {
				firstData = newData;
				setLastData(newData);
			}

			String oldData[] = getLastData(); // .split(",")

			int[] delta = new int[12];

			delta[0] = Integer.parseInt(newData[0]) - Integer.parseInt(oldData[0]);
			delta[1] = Integer.parseInt(newData[1]) - Integer.parseInt(oldData[1]);
			delta[2] = Integer.parseInt(newData[2]) - Integer.parseInt(oldData[2]);
			delta[3] = Integer.parseInt(newData[3]) - Integer.parseInt(oldData[3]);
			delta[4] = Integer.parseInt(newData[4]) - Integer.parseInt(oldData[4]);
			delta[5] = Integer.parseInt(newData[5]) - Integer.parseInt(oldData[5]);
			delta[6] = Integer.parseInt(newData[6]) - Integer.parseInt(oldData[6]);
			delta[7] = Integer.parseInt(newData[7]) - Integer.parseInt(oldData[7]);

			setLastData(newData);

			networkGprsReceiveSpeed = delta[0] / (timeDelay / 1000);
			networkGprsTransmitSpeed = delta[2] / (timeDelay / 1000);
			networkWifiReceiveSpeed = delta[4] / (timeDelay / 1000);
			networkWifiTransmitSpeed = delta[6] / (timeDelay / 1000);

			networkGprsReceiveTraffic = Long.parseLong(newData[0]); // - Long.parseLong(firstData[0]);
			networkGprsTransmitTraffic = Long.parseLong(newData[2]); // - Long.parseLong(firstData[2]);
			networkWifiReceiveTraffic = Long.parseLong(newData[4]); // - Long.parseLong(firstData[4]);
			networkWifiTransmitTraffic = Long.parseLong(newData[6]); // - Long.parseLong(firstData[6]);

		}

	}
        ;
   
	//
	// экран с координатами. путём пройденым ( кнопкой сброса), скоростью. с компасом, наклоном устройства-гироском и
	// тд
	//

	public abstract TreeMap<String, String> get();
	
	private final static String SEPARATE_SPACE = " ";
	private final static String SEPARATE_MANY_SPACE = "\\s+";
	private final static String FILE_MODE_READ = "r";

	private final static String FILE_CPU_INFO = "/proc/cpuinfo";
	private final static String FILE_CPU_CORES = "/sys/devices/system/cpu/";
	private final static String FILE_CPU_FREQUENCY_CUR = "/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq";
	private final static String FILE_CPU_FREQUENCY_MIN = "/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_min_freq";
	private final static String FILE_CPU_FREQUENCY_MAX = "/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq";
	

	private final static String FILE_STAT = "/proc/stat";
	private final static String FILE_MEMORY_INFO = "/proc/meminfo";
	

	public final static String INFO_CPU_USAGE = "cpu_usage";
	public final static String INFO_CPU_PROCESSOR = "cpu_processor";
	public final static String INFO_CPU_CORES = "cpu_cores";
	public final static String INFO_CPU_BOGO_MIPS = "cpu_bogo_mips";
	public final static String INFO_CPU_FREQUENCY_CUR = "cpu_frequency_cur";
	public final static String INFO_CPU_FREQUENCY_MIN = "cpu_frequency_min";
	public final static String INFO_CPU_FREQUENCY_MAX = "cpu_frequency_max";

	public final static String INFO_MEMORY_USAGE = "memory_usage";
	public final static String INFO_MEMORY_TOTAL = "memory_total";
	public final static String INFO_MEMORY_FREE = "memory_free";
	public final static String INFO_MEMORY_USED = "memory_used";

	public final static String INFO_BATERRY_LAVEL = "baterry_lavel";
	public final static String INFO_BATERRY_TEMPERATURE = "baterry_temperature";
	
	public final static String INFO_STORAGE_INTERNAL_USAGE = "storage_internal_usage";
	public final static String INFO_STORAGE_INTERNAL_TOTAL = "storage_internal_total";
	public final static String INFO_STORAGE_INTERNAL_FREE = "storage_internal_free";
	public final static String INFO_STORAGE_INTERNAL_USED = "storage_internal_used";

	public final static String INFO_STORAGE_EXTERNAL_USAGE = "storage_external_usage";
	public final static String INFO_STORAGE_EXTERNAL_TOTAL = "storage_external_total";
	public final static String INFO_STORAGE_EXTERNAL_FREE = "storage_external_free";
	public final static String INFO_STORAGE_EXTERNAL_USED = "storage_external_used";
	
	public final static String INFO_ANDROID_VERSION = "android_version";

	public final static String INFO_PHONE_MODEL = "phone_model";

	public final static String INFO_NETWORK_WIFI_TRANSMIT_TRAFFIC = "network_wifi_transmit_count";
	public final static String INFO_NETWORK_WIFI_TRANSMIT_SPEED = "network_wifi_transmit_speed";
	public final static String INFO_NETWORK_WIFI_RECEIVE_TRAFFIC = "network_wifi_receive_count";
	public final static String INFO_NETWORK_WIFI_RECEIVE_SPEED = "network_wifi_receive_speed";
	
	public final static String INFO_NETWORK_GPRS_TRANSMIT_TRAFFIC = "network_gprs_transmit_count";
	public final static String INFO_NETWORK_GPRS_TRANSMIT_SPEED = "network_gprs_transmit_speed";
	public final static String INFO_NETWORK_GPRS_RECEIVE_TRAFFIC = "network_gprs_receive_count";
	public final static String INFO_NETWORK_GPRS_RECEIVE_SPEED = "network_gprs_receive_speed";

	public final static String INFO_NETWORK_LOG = "network_log";

}